module CommentsHelper
	
	# Emits the HTML for nested comments
	def nested_comments(comments)
		comments.map do |comment, sub_comments|
			if sub_comments.any?
				nested = content_tag(:div, nested_comments(sub_comments), :class => "nested_comment")
			else
				nested = ''
			end
			render(comment) + nested
		end.join.html_safe
	end
	
end
